package tests;

import static org.junit.Assert.*;

import model.MediaProperty;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import view.MediaFormatTypeEnum;

import com.google.appengine.tools.development.testing.LocalDatastoreServiceTestConfig;
import com.google.appengine.tools.development.testing.LocalServiceTestHelper;

public class MediaPropertyTest {

	
	private final LocalServiceTestHelper helper =
	            new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
	
	@Before
	public void setUp() {
		helper.setUp();
	}
	
	@After
	public void tearDown() {
		helper.tearDown();
	}
	
	@Test
	public void testConstructor() {
		MediaProperty test = new MediaProperty("testname","name",true,true,true,true,true, MediaFormatTypeEnum.DEFAULT);
	}
	
	@Test
	public void testCompare() {
		MediaProperty first = new MediaProperty("testname","name",true,true,true,true,true,MediaFormatTypeEnum.DELETE_LINK);
		MediaProperty second = new MediaProperty("testname","name",true,true,true,true,true, MediaFormatTypeEnum.DELETE_LINK);
		// Two MediaProperty are considered different if and only if they are the same object,
		// not having the same property
		assertFalse(first.compareTo(second) == 0);
		assertTrue(first.compareTo(first)== 0);
	}
}
